﻿using SweetSurvey.Models.Repositories;
using System;

namespace SweetSurvey.Models.ViewModels
{
    public class SurveyViewModel
    {
        public SurveyViewModel(Survey survey, IParticipatorRepository participatorRepository)
        {
            this.Id = survey.Id;
            this.Title = survey.Title;
            this.Participators = participatorRepository.GetParticipatorCountBySurveyId(survey.Id);
            this.DateCreated = survey.DateCreated;
        }

        public string Id { get; set; }
        public string Title { get; set; }
        public int Participators { get; set; }
        public DateTime DateCreated { get; set; }
    }
}